/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Servidor;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author daniel
 */
@Entity
@Table(name = "Directorio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Directorio.findAll", query = "SELECT d FROM Directorio d"),
    @NamedQuery(name = "Directorio.findByIDDirectorio", query = "SELECT d FROM Directorio d WHERE d.iDDirectorio = :iDDirectorio"),
    @NamedQuery(name = "Directorio.findByDirectorioDir", query = "SELECT d FROM Directorio d WHERE d.directorioDir = :directorioDir"),
    @NamedQuery(name = "Directorio.findByDirectorioEsp", query = "SELECT d FROM Directorio d WHERE d.directorioEsp = :directorioEsp"),
    @NamedQuery(name = "Directorio.findByIDNodo", query = "SELECT d FROM Directorio d WHERE d.fkNodoDirectorio = :IDNodo")})
public class Directorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IDDirectorio")
    private Integer iDDirectorio;
    @Basic(optional = false)
    @Column(name = "directorio_dir")
    private String directorioDir;
    @Basic(optional = false)
    @Column(name = "directorio_esp")
    private String directorioEsp;
    @JoinColumn(name = "fk_nodo_directorio", referencedColumnName = "IDNodo")
    @ManyToOne
    private Nodo fkNodoDirectorio;

    public Directorio() {
    }

    public Directorio(Integer iDDirectorio) {
        this.iDDirectorio = iDDirectorio;
    }

    public Directorio(Integer iDDirectorio, String directorioDir, String directorioEsp) {
        this.iDDirectorio = iDDirectorio;
        this.directorioDir = directorioDir;
        this.directorioEsp = directorioEsp;
    }

    public Integer getIDDirectorio() {
        return iDDirectorio;
    }

    public void setIDDirectorio(Integer iDDirectorio) {
        this.iDDirectorio = iDDirectorio;
    }

    public String getDirectorioDir() {
        return directorioDir;
    }

    public void setDirectorioDir(String directorioDir) {
        this.directorioDir = directorioDir;
    }

    public String getDirectorioEsp() {
        return directorioEsp;
    }

    public void setDirectorioEsp(String directorioEsp) {
        this.directorioEsp = directorioEsp;
    }

    public Nodo getFkNodoDirectorio() {
        return fkNodoDirectorio;
    }

    public void setFkNodoDirectorio(Nodo fkNodoDirectorio) {
        this.fkNodoDirectorio = fkNodoDirectorio;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (iDDirectorio != null ? iDDirectorio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Directorio)) {
            return false;
        }
        Directorio other = (Directorio) object;
        if ((this.iDDirectorio == null && other.iDDirectorio != null) || (this.iDDirectorio != null && !this.iDDirectorio.equals(other.iDDirectorio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Servidor.Directorio[ iDDirectorio=" + iDDirectorio + " ]";
    }
    
}
